﻿CREATE TABLE [dbo].[OrderNotifyLog] (
    [Id]             BIGINT          IDENTITY (1, 1) NOT NULL,
    [SignType]       NVARCHAR (8)    NULL,
    [ServiceVersion] NVARCHAR (8)    NULL,
    [InputCharset]   NVARCHAR (8)    NULL,
    [Sign]           NVARCHAR (32)   NULL,
    [SignKeyIndex]   INT             NULL,
    [TradeMode]      INT             NULL,
    [TradeState]     INT             NULL,
    [PayInfo]        NVARCHAR (64)   NULL,
    [Partner]        NVARCHAR (10)   NULL,
    [BankType]       NVARCHAR (16)   NULL,
    [BankBillNo]     NVARCHAR (32)   NULL,
    [TotalFee]       INT             NULL,
    [FeeType]        INT             NULL,
    [NotifyId]       NVARCHAR (128)  NULL,
    [TransactionId]  NVARCHAR (28)   NULL,
    [OutTradeNo]     NVARCHAR (32)   NULL,
    [Attach]         NVARCHAR (128)  NULL,
    [TimerEnd]       NVARCHAR (14)   NULL,
    [TransportFee]   INT             NULL,
    [ProductFee]     INT             NULL,
    [Discount]       INT             NULL,
    [BuyerAlias]     NVARCHAR (64)   NULL,
    [Uri]            NTEXT           NULL,
    [PostData]       NVARCHAR (2000) NULL,
    [IsVerified]     INT             NULL,
    [CreateDate]     DATETIME        NULL,
    [Remark]         NVARCHAR (200)  NULL,
    CONSTRAINT [PK_OrderNotifyLog] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'签名方式, 签名类型，取值：MD5、RSA，默认：MD5', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'SignType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'接口版本，版本号，默认为 1.0', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'ServiceVersion';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'字符集, 字符编码,取值：GBK、UTF-8，默认：GBK', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'InputCharset';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'签名', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'Sign';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'密钥序号, 多密钥支持的密钥序号，默认 1', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'SignKeyIndex';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'交易模式, 1-即时到账', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'TradeMode';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'支付结果信息, 支付结果信息,支付成功时为空', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'TradeState';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'支付结果信息,支付成功时为空', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'PayInfo';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'商户号，也即之前步骤的 partnerid,由微信统一分配的 10 位正整数(120XXXXXXX)号', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'Partner';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'银行类型，在微信中使用 WX', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'BankType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'银行订单号', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'BankBillNo';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'支付金额，单位为分，如果 discount有值，通知的 total_fee + discount = 请求的 total_fee', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'TotalFee';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'现金支付币种, 目前只支持人民币,默认值是 1-人民币', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'FeeType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'支付结果通知 id，对亍某些特定商户，只返回通知 id，要求商户据此查询交易结果', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'NotifyId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'交易号， 28 位长的数值，其中前 10位为商户号，之后 8 位为订单产生的日期，如 20090415，最后 10 位是流水号。', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'TransactionId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'商户系统的订单号，与请求一致。', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'OutTradeNo';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'商户数据包，原样返回', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'Attach';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'支付完成时间，格式为yyyyMMddhhmmss，如 2009 年 12月 27 日 9 点 10 分 10 秒表示为20091227091010。时区为 GMT+8 beijing。', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'TimerEnd';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'物流费用，单位分，默认 0。如果有值，必须保证 transport_fee  +  product_fee = total_fee', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'TransportFee';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'物品费用，单位分。如果有值，必须保证 transport_fee  + product_fee=total_fee', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'ProductFee';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'折扣价格，单位分，如果有值，通知的 total_fee  +  discount  =  请求的total_fee', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'Discount';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'对应买家账号的一个加密串', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'BuyerAlias';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'通知的URL', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'Uri';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'post的body字符串', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'PostData';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否验证通过，1：通过', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'IsVerified';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'生成时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'CreateDate';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'备注', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'OrderNotifyLog', @level2type = N'COLUMN', @level2name = N'Remark';

